const form = document.forms[0]

import ajax from "../utils/ajax"

form.onsubmit = function (e) {
    e.preventDefault()
    ajax('post', '/api/manage/admins_add/add', {
        uid: form.uid.value,
        pwd: form.pwd.value
    })
        .then(result => {
            if (result.flag) {
                alert('注册成功')
            } else {
                alert(result.msg)
            }
        })
}